using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Text;

namespace Data_Access_Tier
{
	public class DIC_SHIFTData : DatabaseObjectBase
	{
		public DIC_SHIFTData()
		{
			Initialize(true);
		}
		public DIC_SHIFTData(Boolean newConnection)
		{
			Initialize(newConnection);
		}

		public Int32 DIC_SHIFT_Insert(String ShiftCode, String ShiftName, DateTime BeginTime, DateTime EndTime, Boolean IsOvernight, DateTime BeginTime1, DateTime BeginTime2, DateTime EndTime1, DateTime EndTime2, Int32 LateMinute, Int32 EarlyMinute, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.InsertCommand = new SqlCommand("DIC_SHIFT_Insert");
				_dbadapter.InsertCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.InsertCommand.Connection = _dbconn;
				_trans = _dbconn.BeginTransaction();
				_dbadapter.InsertCommand.Transaction = _trans;
				_dbadapter.InsertCommand.Parameters.Clear();
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@ShiftName", SqlDbType.NVarChar, 100));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@BeginTime", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@IsOvernight", SqlDbType.Bit));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@BeginTime1", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@BeginTime2", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EndTime1", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EndTime2", SqlDbType.DateTime));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@LateMinute", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@EarlyMinute", SqlDbType.Int));
				_dbadapter.InsertCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.InsertCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.InsertCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				SqlString ShiftNameSQL = ShiftName;
				_dbadapter.InsertCommand.Parameters["@ShiftName"].Value = ShiftNameSQL;
				SqlDateTime BeginTimeSQL = SqlDateTime.Null;
				if (BeginTime > DateTime.MinValue)
				{
					try
					{
						BeginTimeSQL = BeginTime;
					}
					catch (Exception eBeginTime)
					{
						String BeginTimeMessage = eBeginTime.Message;
						BeginTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@BeginTime"].Value = BeginTimeSQL;
				SqlDateTime EndTimeSQL = SqlDateTime.Null;
				if (EndTime > DateTime.MinValue)
				{
					try
					{
						EndTimeSQL = EndTime;
					}
					catch (Exception eEndTime)
					{
						String EndTimeMessage = eEndTime.Message;
						EndTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@EndTime"].Value = EndTimeSQL;
				SqlBoolean IsOvernightSQL = IsOvernight;
				_dbadapter.InsertCommand.Parameters["@IsOvernight"].Value = IsOvernightSQL;
				SqlDateTime BeginTime1SQL = SqlDateTime.Null;
				if (BeginTime1 > DateTime.MinValue)
				{
					try
					{
						BeginTime1SQL = BeginTime1;
					}
					catch (Exception eBeginTime1)
					{
						String BeginTime1Message = eBeginTime1.Message;
						BeginTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@BeginTime1"].Value = BeginTime1SQL;
				SqlDateTime BeginTime2SQL = SqlDateTime.Null;
				if (BeginTime2 > DateTime.MinValue)
				{
					try
					{
						BeginTime2SQL = BeginTime2;
					}
					catch (Exception eBeginTime2)
					{
						String BeginTime2Message = eBeginTime2.Message;
						BeginTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@BeginTime2"].Value = BeginTime2SQL;
				SqlDateTime EndTime1SQL = SqlDateTime.Null;
				if (EndTime1 > DateTime.MinValue)
				{
					try
					{
						EndTime1SQL = EndTime1;
					}
					catch (Exception eEndTime1)
					{
						String EndTime1Message = eEndTime1.Message;
						EndTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@EndTime1"].Value = EndTime1SQL;
				SqlDateTime EndTime2SQL = SqlDateTime.Null;
				if (EndTime2 > DateTime.MinValue)
				{
					try
					{
						EndTime2SQL = EndTime2;
					}
					catch (Exception eEndTime2)
					{
						String EndTime2Message = eEndTime2.Message;
						EndTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.InsertCommand.Parameters["@EndTime2"].Value = EndTime2SQL;
				SqlInt32 LateMinuteSQL = LateMinute;
				_dbadapter.InsertCommand.Parameters["@LateMinute"].Value = LateMinuteSQL;
				SqlInt32 EarlyMinuteSQL = EarlyMinute;
				_dbadapter.InsertCommand.Parameters["@EarlyMinute"].Value = EarlyMinuteSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.InsertCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.InsertCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SHIFT_Insert: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SHIFT_Insert: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.InsertCommand != null)
					_dbadapter.InsertCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SHIFT_Update(String ShiftCode, String ShiftName, DateTime BeginTime, DateTime EndTime, Boolean IsOvernight, DateTime BeginTime1, DateTime BeginTime2, DateTime EndTime1, DateTime EndTime2, Int32 LateMinute, Int32 EarlyMinute, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SHIFT_Update");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@ShiftName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsOvernight", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime1", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime2", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime1", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime2", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@LateMinute", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EarlyMinute", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.UpdateCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				SqlString ShiftNameSQL = ShiftName;
				_dbadapter.UpdateCommand.Parameters["@ShiftName"].Value = ShiftNameSQL;
				SqlDateTime BeginTimeSQL = SqlDateTime.Null;
				if (BeginTime > DateTime.MinValue)
				{
					try
					{
						BeginTimeSQL = BeginTime;
					}
					catch (Exception eBeginTime)
					{
						String BeginTimeMessage = eBeginTime.Message;
						BeginTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime"].Value = BeginTimeSQL;
				SqlDateTime EndTimeSQL = SqlDateTime.Null;
				if (EndTime > DateTime.MinValue)
				{
					try
					{
						EndTimeSQL = EndTime;
					}
					catch (Exception eEndTime)
					{
						String EndTimeMessage = eEndTime.Message;
						EndTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime"].Value = EndTimeSQL;
				SqlBoolean IsOvernightSQL = IsOvernight;
				_dbadapter.UpdateCommand.Parameters["@IsOvernight"].Value = IsOvernightSQL;
				SqlDateTime BeginTime1SQL = SqlDateTime.Null;
				if (BeginTime1 > DateTime.MinValue)
				{
					try
					{
						BeginTime1SQL = BeginTime1;
					}
					catch (Exception eBeginTime1)
					{
						String BeginTime1Message = eBeginTime1.Message;
						BeginTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime1"].Value = BeginTime1SQL;
				SqlDateTime BeginTime2SQL = SqlDateTime.Null;
				if (BeginTime2 > DateTime.MinValue)
				{
					try
					{
						BeginTime2SQL = BeginTime2;
					}
					catch (Exception eBeginTime2)
					{
						String BeginTime2Message = eBeginTime2.Message;
						BeginTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime2"].Value = BeginTime2SQL;
				SqlDateTime EndTime1SQL = SqlDateTime.Null;
				if (EndTime1 > DateTime.MinValue)
				{
					try
					{
						EndTime1SQL = EndTime1;
					}
					catch (Exception eEndTime1)
					{
						String EndTime1Message = eEndTime1.Message;
						EndTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime1"].Value = EndTime1SQL;
				SqlDateTime EndTime2SQL = SqlDateTime.Null;
				if (EndTime2 > DateTime.MinValue)
				{
					try
					{
						EndTime2SQL = EndTime2;
					}
					catch (Exception eEndTime2)
					{
						String EndTime2Message = eEndTime2.Message;
						EndTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime2"].Value = EndTime2SQL;
				SqlInt32 LateMinuteSQL = LateMinute;
				_dbadapter.UpdateCommand.Parameters["@LateMinute"].Value = LateMinuteSQL;
				SqlInt32 EarlyMinuteSQL = EarlyMinute;
				_dbadapter.UpdateCommand.Parameters["@EarlyMinute"].Value = EarlyMinuteSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SHIFT_Update: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SHIFT_Update: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SHIFT_Disable(String ShiftCode, ref Boolean Enabled)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SHIFT_Disable");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@enabled", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.UpdateCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				_dbadapter.UpdateCommand.Parameters["@enabled"].Direction = ParameterDirection.Output;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SHIFT_Disable: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SHIFT_Disable: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SHIFT_Delete(String ShiftCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.DeleteCommand = new SqlCommand("DIC_SHIFT_Delete");
				_dbadapter.DeleteCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.DeleteCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.DeleteCommand.Transaction = _trans;

				_dbadapter.DeleteCommand.Parameters.Clear();
				_dbadapter.DeleteCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.DeleteCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.DeleteCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.DeleteCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SHIFT_Delete: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SHIFT_Delete: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.DeleteCommand != null)
					_dbadapter.DeleteCommand.Dispose();
				CloseConnection();
			}
		}
		public Int32 DIC_SHIFT_Save(String ShiftCode, String ShiftName, DateTime BeginTime, DateTime EndTime, Boolean IsOvernight, DateTime BeginTime1, DateTime BeginTime2, DateTime EndTime1, DateTime EndTime2, Int32 LateMinute, Int32 EarlyMinute, String Description)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.UpdateCommand = new SqlCommand("DIC_SHIFT_Save");
				_dbadapter.UpdateCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.UpdateCommand.Connection = _dbconn;

				_trans = _dbconn.BeginTransaction();
				_dbadapter.UpdateCommand.Transaction = _trans;

				_dbadapter.UpdateCommand.Parameters.Clear();
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@ShiftName", SqlDbType.NVarChar, 100));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@IsOvernight", SqlDbType.Bit));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime1", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@BeginTime2", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime1", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EndTime2", SqlDbType.DateTime));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@LateMinute", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@EarlyMinute", SqlDbType.Int));
				_dbadapter.UpdateCommand.Parameters.Add(new SqlParameter("@Description", SqlDbType.NVarChar, 255));
				_dbadapter.UpdateCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.UpdateCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				SqlString ShiftNameSQL = ShiftName;
				_dbadapter.UpdateCommand.Parameters["@ShiftName"].Value = ShiftNameSQL;
				SqlDateTime BeginTimeSQL = SqlDateTime.Null;
				if (BeginTime > DateTime.MinValue)
				{
					try
					{
						BeginTimeSQL = BeginTime;
					}
					catch (Exception eBeginTime)
					{
						String BeginTimeMessage = eBeginTime.Message;
						BeginTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime"].Value = BeginTimeSQL;
				SqlDateTime EndTimeSQL = SqlDateTime.Null;
				if (EndTime > DateTime.MinValue)
				{
					try
					{
						EndTimeSQL = EndTime;
					}
					catch (Exception eEndTime)
					{
						String EndTimeMessage = eEndTime.Message;
						EndTimeSQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime"].Value = EndTimeSQL;
				SqlBoolean IsOvernightSQL = IsOvernight;
				_dbadapter.UpdateCommand.Parameters["@IsOvernight"].Value = IsOvernightSQL;
				SqlDateTime BeginTime1SQL = SqlDateTime.Null;
				if (BeginTime1 > DateTime.MinValue)
				{
					try
					{
						BeginTime1SQL = BeginTime1;
					}
					catch (Exception eBeginTime1)
					{
						String BeginTime1Message = eBeginTime1.Message;
						BeginTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime1"].Value = BeginTime1SQL;
				SqlDateTime BeginTime2SQL = SqlDateTime.Null;
				if (BeginTime2 > DateTime.MinValue)
				{
					try
					{
						BeginTime2SQL = BeginTime2;
					}
					catch (Exception eBeginTime2)
					{
						String BeginTime2Message = eBeginTime2.Message;
						BeginTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@BeginTime2"].Value = BeginTime2SQL;
				SqlDateTime EndTime1SQL = SqlDateTime.Null;
				if (EndTime1 > DateTime.MinValue)
				{
					try
					{
						EndTime1SQL = EndTime1;
					}
					catch (Exception eEndTime1)
					{
						String EndTime1Message = eEndTime1.Message;
						EndTime1SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime1"].Value = EndTime1SQL;
				SqlDateTime EndTime2SQL = SqlDateTime.Null;
				if (EndTime2 > DateTime.MinValue)
				{
					try
					{
						EndTime2SQL = EndTime2;
					}
					catch (Exception eEndTime2)
					{
						String EndTime2Message = eEndTime2.Message;
						EndTime2SQL = SqlDateTime.Null;
					}
				}
				_dbadapter.UpdateCommand.Parameters["@EndTime2"].Value = EndTime2SQL;
				SqlInt32 LateMinuteSQL = LateMinute;
				_dbadapter.UpdateCommand.Parameters["@LateMinute"].Value = LateMinuteSQL;
				SqlInt32 EarlyMinuteSQL = EarlyMinute;
				_dbadapter.UpdateCommand.Parameters["@EarlyMinute"].Value = EarlyMinuteSQL;
				SqlString DescriptionSQL = Description;
				_dbadapter.UpdateCommand.Parameters["@Description"].Value = DescriptionSQL;
				Int32 returnvalue = Convert.ToInt32(_dbadapter.UpdateCommand.ExecuteScalar());

				_trans.Commit();
				return returnvalue;
			}
			catch (SqlException e)
			{
				try
				{
					_trans.Rollback();
				}
				catch (SqlException ex)
				{
					throw new Exception("SQL Rollback Error: DIC_SHIFT_Save: " + ex.Message, ex);
				}
				throw new Exception("SQL Error: DIC_SHIFT_Save: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.UpdateCommand != null)
					_dbadapter.UpdateCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet DIC_SHIFT_GetList()
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("DIC_SHIFT_GetList");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Prepare();
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: DIC_SHIFT_GetList: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
		public DataSet DIC_SHIFT_Get(String ShiftCode)
		{
			try
			{
				if (_dbconn.State != ConnectionState.Open)
					_dbconn.Open();
				_dbadapter.SelectCommand = new SqlCommand("DIC_SHIFT_Get");
				_dbadapter.SelectCommand.CommandType = CommandType.StoredProcedure;
				_dbadapter.SelectCommand.Connection = _dbconn;
				_dbadapter.SelectCommand.Parameters.Clear();
				_dbadapter.SelectCommand.Parameters.Add(new SqlParameter("@ShiftCode", SqlDbType.VarChar, 20));
				_dbadapter.SelectCommand.Prepare();
				SqlString ShiftCodeSQL = ShiftCode;
				_dbadapter.SelectCommand.Parameters["@ShiftCode"].Value = ShiftCodeSQL;
				_dbadapter.Fill(_data);

				return _data;
			}
			catch (SqlException e)
			{
				throw new Exception("SQL Error: DIC_SHIFT_Get: " + e.Message, e);
			}
			finally
			{
				if (_dbadapter.SelectCommand != null)
					_dbadapter.SelectCommand.Dispose();
				CloseConnection();
			}
		}
	}
}
